package file;

import java.io.File;
import java.io.IOException;

/**
 * parent:父母
 *
 * File(file parent,String pathname)
 * 参数1:当前
 */
public class FileDemo2 {
    public static void main(String[] args) throws IOException {
        File dir = new File(".text");
        if(!dir.exists()){
            dir.mkdirs();
        }
        File file = new File(dir,"demo.txt");
        if (!file.exists()){
            file.createNewFile();
        }

    }
}
